package JAVA300.第十章IO;

import java.io.File;

/**
 *p168-IO 路径及构造函数
 *
 */


public class PathDemo01 {
    public static void main(String[] args) {
        String path = "/Users/hqqs/Documents/CodeJava/JavaSE_Exp/src/JAVA300/第十章IO/1.jpg";
        System.out.println(File.separatorChar);

        //1.构建file对象
        //（路径）
        File file = new File(path);
        //（父路径，后续子路径）
        File file1 = new File("/Users/hqqs/Documents/CodeJava/JavaSE_Exp/src/JAVA300/第十章IO","1.jpg");
        //(file对象，后续子路径)
        File file2 = new File(new File("/Users/hqqs/Documents/CodeJava/JavaSE_Exp/src/JAVA300/第十章IO"),"1.jpg");

        //2.相对 绝对路径
        file = new File("1.jpg");
        System.out.println(System.getProperty("user.dir"));
        System.out.println(file.getAbsoluteFile());



    }
}
